<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Kategori extends CI_Controller {

	function __construct()
	{
		parent::Controller();
		$this->load->model('Produk_model');
		$this->load->library('session');
		$this->load->helper('url');
		$this->load->helper('bantuan_helper');
	}
	

	function index()
	{
		$kat_id=$this->uri->segment(3);
		
		
		$this->db->where('kategori_id',$kat_id);
		$query = $this->db->get('tb_kat_produk');
		$row = $query->row();
	
		$this->load->library('pagination');
		$offset = $this->uri->segment(2);
		$config['base_url'] = site_url().'/kategori/index';
		$config['total_rows'] = count($this->Produk_model->getProduk('AllByCat',$kat_id,FALSE,FALSE));
		$config['per_page'] = 12;
		$config['uri_segment'] = 3;
		$config['next_link'] = '&raquo;';
		$config['prev_link'] = '&laquo;';
		
		$data['cumb'] = anchor('home','Home').' &raquo; '.anchor('produk',$row->nama_kategori);
		$data['title'] = $row->nama_kategori;
	
		$data['res_ven'] = $this->Produk_model->getProdukKatVen('VendorByKat',$id,FALSE,FALSE,FALSE);
		$data['arr_produk'] = $this->Produk_model->getProduk('AllByCat',$kat_id,$config['per_page'],$offset);
		$data['main_view'] = 'kategori';
		$this->load->view('/index',$data);
	}
	
}



/* End of file welcome.php */
/* Location: ./system/application/controllers/home.php */